Skip to content

Conversation

melocery
Copy link

Close #879

Added support for spatialleiden as a flavor in sq.gr.calculate_niche, following up on the idea mentioned in #879. The method is now integrated via the flavor="spatialleiden" option, wrapping the spatialleiden.spatialleiden() function.

@melocery
Copy link
Author

@niklasmueboe FYI as the author of spatialleiden.

This PR adds spatialleiden as an option in sq.gr.calculate_niche() via the flavor argument.
Note: spatialleiden depends on leidenalg, which was removed as a hard dependency in PR #972 to keep BSD3 compliance. So, there might be some overlap or conflicts to consider regarding dependencies.

@codecov-commenter
Copy link

codecov-commenter commented Jul 31, 2025

Codecov Report

❌ Patch coverage is 16.00000% with 42 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.19%. Comparing base (d8b8f91) to head (39f7ea8).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
src/squidpy/gr/_niche.py 14.28% 34 Missing and 8 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1019      +/-   ##
==========================================
- Coverage   66.63%   66.19%   -0.45%     
==========================================
  Files          40       40              
  Lines        6060     6093      +33     
  Branches     1015     1031      +16     
==========================================
- Hits         4038     4033       -5     
- Misses       1662     1698      +36     
- Partials      360      362       +2     
Files with missing lines Coverage Δ
src/squidpy/_constants/_constants.py 100.00% <100.00%> (ø)
src/squidpy/gr/_niche.py 32.52% <14.28%> (-2.35%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add SpatialLeiden as clustering method

3 participants